<?php if (isset($this->options)):?>
<?php $poll = $this->question;?>
<div class="done_editing"><a href="javascript:void(0)" onclick="Poll.doneEditing(<?php echo $poll->getIdentity();?>);" class="fb_confirm fb_btn"><?php echo $this->translate('Done Editing');?></a></div>
<ul class="poll_options">
    <?php foreach ($this->options as $option): ?>
        <li>
            <div class="options_checkbox"></div>
            <div class="options_content <?php if ($option->votes):?>voted<?php endif;?>">
                <?php
                $percent = $poll->total_votes ? round($option->votes / $poll->total_votes, 2) * 100 : 0;                    
                ?>
                <?php if ($option->votes && $percent):?><div class="options_content_shade" style="width: <?php echo $percent;?>%;"></div><?php endif; ?>
                <div class="options_content_label"><?php echo $option->getTitle();?></div>
                <div class="options_content_votes"><span class="pad-top"></span><?php echo $option->votes; ?> <?php echo ($option->votes == 1) ? $this->translate('vote') : $this->translate('votes');?></div>
            </div>
            <div class="options_button">
                <a href="javascript:void(0);" onclick="Poll.delOpt($(this).getParent('div').getParent('li'), <?php echo $poll->getIdentity();?>, <?php echo $option->getIdentity();?>)"><i class="dClose"></i></a>
            </div>
        </li>                                    
    <?php endforeach; ?> 
</ul>
<div class="clear"></div>
<div class="uiSideHeader">
    <div class="headTitle"><?php echo $this->translate('Ask By');?></div> 
    <div class="iRight"><?php echo $this->question->total_votes; ?> <?php echo ($this->question->total_votes == 1) ? $this->translate('vote') : $this->translate('votes');?></div>
</div>
<div class="owner_information">
    <?php $owner = $this->question->getOwner(); ?>
    <div class="owner_photo"><?php echo $this->htmlLink($owner->getHref(), $this->uPhoto($owner, 'thumb.icon'), array('class' => 'item_big'));?></div>
    <div class="owner_brief">
        <span class="owner_title"><?php echo $this->htmlLink($owner->getHref(), $owner->getTitle());?></span>
        <div class="poll_action">
        <?php echo $this->timestamp($this->question->creation_date);?> · 
        <?php 
        $viewer = Engine_Api::_()->user()->getViewer();
        ?>
        <?php if ($viewer->getIdentity() == $this->question->user_id): ?>
        <?php $token = base64_encode($this->question->getIdentity());?>
        <a href="javascript:void(0);" onclick="Poll.deletePoll('<?php echo $token;?>')"><?php echo $this->translate('Delete');?></a>
        <?php endif; ?>
        </div>
    </div>
</div>
<?php endif;?>